{include file="common/_header-css"}

<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
                <a>首页</a>
                <a>权限管理</a>
                <a>
                    <cite>管理员管理</cite>
                </a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
    </a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <button class="layui-btn" onclick="xadmin.open('添加管理员','{:url(\'permissions/administrator_curd\')}?type=1',400,400)">
                        <i class="layui-icon"></i>添加</button></div>
                <div class="layui-card-body ">
                    <table class="layui-table layui-form">

                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>账号</th>
                                <th>用户组</th>
                                <th>状态</th>
                                <th>加入时间</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{$vo.account}</td>
                                <td>
                                    <button class="layui-btn layui-btn-xs layui-btn-radius layui-btn-normal">
                                        {$vo.related_auth_group_access.related_auth_group.title}
                                    </button>
                                </td>
                                <td>{if $vo.status == 1}
                                    <button class="layui-btn layui-btn-xs layui-btn-radius layui-btn-normal">正常</button>
                                    {else /}
                                    <button class="layui-btn layui-btn-xs layui-btn-radius layui-btn-danger">禁用</button>
                                    {/if}
                                </td>
                                <td>{$vo.create_time}</td>
                                <td class="td-manage">
                                    {if $vo.account != 'admin'}
                                    <a title="删除" onclick="member_del(this,'{$vo.id}')" href="javascript:;">
                                        <i class="layui-icon">&#xe640;</i></a>
                                    {/if}
                                </td>
                            </tr>
                            {/volist}
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        {$list|raw}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use(['laydate', 'form']);

    function member_del(Obj,id) {
        layer.alert('您确定要删除吗?',function () {
            $.post('{:url(\'permissions/administrator_delete\')}',{id:id},function (res) {
                if (res.code == 200) {
                    layer.msg(res.msg,{icon: 6,time:500},function () {
                        location.reload();
                    });
                }else{
                    layer.msg(res.msg,{icon: 5,time:500});
                }
            });

        })
    }
</script>

</html>